﻿Namespace OpenCL
    Public Class Context
        Public Property InternalPointer() As IntPtr
            Get
                Return m_InternalPointer
            End Get
            Private Set(ByVal value As IntPtr)
                m_InternalPointer = value
            End Set
        End Property
        Private m_InternalPointer As IntPtr

        Public Sub New(ByVal devices As IntPtr())
            Dim [error] As Integer
            InternalPointer = OpenCLAPI.clCreateContext(Nothing, devices.Length, devices, Nothing, IntPtr.Zero, [error])
        End Sub

        Protected Overrides Sub Finalize()
            Try
                OpenCLAPI.clReleaseContext(InternalPointer)
            Finally
                MyBase.Finalize()
            End Try
        End Sub
    End Class
End Namespace